package com.wx_zgwl_ribbon;

import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.time.Period;

/**
 * 刘强
 *
 * @author
 * @create 2018-01-16 19:52
 **/
@RestController
public class MyController {
    @GetMapping(value = "/person/{personId}",produces = MediaType.APPLICATION_JSON_VALUE)
    public Preson findPerson(@PathVariable("personId") Integer presonId, HttpServletRequest request){
        Preson preson=new Preson();
        preson.setAge("123");
        preson.setId(presonId+"");
        preson.setName(request.getRequestURI().toString());

        return preson;
    }

    @GetMapping(value = "/")
    public String  hello() {
        return "hello";
    }

}
